home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 24 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: isar.de!news
  2. From: imd@m.isar.de (Thomas Doerfler)
  3. Newsgroups: comp.sys.m68k
  4. Subject: Re: BSR vs. JSR
  5. Date: Fri, 05 Jan 1996 08:47:53 GMT
  6. Organization: IMD
  7. Message-ID: <4ciod6$nko@nixe.isar.net>
  8. References: <30EBF0B3.6749@bmdl2.bbn.hp.com> <ludisDKozAI.7pL@netcom.com>
  9. NNTP-Posting-Host: imd.m.isar.de
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ludis@netcom.com (Ludis Langens) wrote:
  13.  
  14. >In article <30EBF0B3.6749@bmdl2.bbn.hp.com> Ernst Geesmann <praktwg@bmdl2.bbn.hp.com> writes:
  15. >>My software uses BSR and JSR instructions.  Everything's fine if
  16. >>the stack is placed into SRAM.  But if I place the stack into DRAM
  17. >>strange things happen:
  18. >>On BSR the return address is pushed to the stack - OK
  19. >>Several BSR follow, each time return address is pushed and
  20. >>can be pulled - OK
  21. >>A JSR is used, return address pushed - OK
  22. >>With the first BSR after this JSR only the lower 16 bit of the
  23. >>return address is pushed to the stack, but the stack pointer is
  24. >>moved for 4 furthter bytes.
  25.  
  26. >Three ideas:
  27. >  1) You have a memory trashing bug.
  28.  
  29. >  2) Your BSRs/JSRs aren't written correctly to deal with 32 bit addresses:
  30. >      You might have exceeded the range of a BSR.W (and your assembler
  31. >      didn't catch it.)  Partial address decoding might make the code
  32. >      run, but the upper word of the PC is wrong.
  33. >      You used JSR <ABS.W> where JSR <ABS.L> is needed.
  34.  
  35. This cannot be, because errors in the target address of a BSR or JSR
  36. would branch (jump) to the wrong address but would _not_ generate a
  37. wrong return address! And return addresses on the stack are always 32
  38. bit long.
  39.  
  40. >  3) You have a memory timing bug (maybe a refresh problem) that just
  41. >     happens to show up where you found it (i.e. it has nothing to do
  42. >     with BSR vs JSR.)
  43.  
  44. Quite probable to me, maybe you used optimized page mode for the DRAM
  45. and you get timing problems...
  46.  
  47.  
  48. >I'd say that #1 is the most likely problem...
  49.  
  50. Another possibility: You have some kind of error in your memory
  51. configuration (you have set a bank to 32 bit or so...). 
  52. Some questions:
  53. Can it be that the first return address corrupted is the first one
  54. that is pushed to a stack location not divisible by 4?
  55. How do you set your memory banks to 16 bit? Do you use the BUSW pin?
  56. And what mask version of the MC68360 do you have? 
  57.  
  58. By, Thomas.
  59.  
  60. --------------------------------------------
  61. IMD Ingenieurbuero fuer Microcomputertechnik
  62. Thomas Doerfler           Elilandstrasse 12
  63. D-81547 Muenchen          Germany
  64. email:    imd@m.isar.de
  65.  
  66.